Adding some more judges, here and there.
[andmenj-acm.git] / UVa / 438 - The circumference of the cirlce / 438.cpp
blob61d09c302d6de2ca53ae796840da0ac0b900d2ba
1 #include <iostream>
2 #include<stdio.h>
3 #include<math.h>
4 using namespace std;
5 struct point{
6 double x;
7 double y;
8 point(double X,double Y){
9 x=X;
10 y=Y;
14 double operator |(point &a,point &b){
15 //return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));
16 return hypot(a.x-b.x, a.y-b.y);
19 const double pi = 2*acos(0);
20 int main(){
23 double x1,x2,x3,y1,y2,y3;
25 while(cin>>x1>>y1>>x2>>y2>>x3>>y3){
26 point p(x1,y1);
27 point q(x2,y2);
28 point r(x3,y3);
29 printf("%.2f\n",fabs(pi*(q|r)*(p|q)*(p|r)/((q.x-p.x)*(r.y-p.y)-(q.y-p.y)*(r.x-p.x))));
32 return 0;